import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";

// vite.config.js
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": resolve(__dirname, "src")
    }
  },
  // 关键修改：指定生产环境基础路径
  base: "/", // 如果部署在子目录则改为'/subdir/'
  build: {
    outDir: "dist",
    assetsDir: "assets",
    manifest: true // 生成manifest文件帮助Nginx处理资源
  },
  server: {
    host: "0.0.0.0",
    port: 5173,
    hmr: true,
    allowedHosts: ["seig.ethank.top"]
  }
});
